#include<stdio.h>

 /*找到数组中两个位置对应的值的和等于target*/
void findNumsTarget(int*nums,int target,int *pos1,int *pos2)
{      
      int length = 0;
      while(nums[length] != '\0')
      {
        length ++;
      }
      for(int i =0;i < length-1;i++)
      for(int j =0;j < length;j++)
      if(nums[i] + nums[j] == target)
      {
         *pos1 = i;
         *pos2 = j;
        break;
      }
}


int main()
{
    int nums[] = {13,21,7,46,12,9,57};
    int target = 25;
    
    int pos1 = 0;
    int pos2 = 0;
    findNumsTarget(nums,target,&pos1,&pos2);

    printf("pos1 = %d,\t pos2 = %d\n",pos1,pos2);

    return 0;
    
}